using IM.Easy.Infrastructure.Query;
using Microsoft.AspNetCore.Http;
using System.ComponentModel.DataAnnotations;


namespace IM.Easy.SystemServices.Dtos
{
    /// <summary>
    /// 文件资源表查询实体
    /// </summary>
    public class FileResourceQueryDto : QueryBase
    {
    }

    public class FileUploadDto
    {
        /// <summary>
        /// 上传的文件
        /// </summary>
        [Required(ErrorMessage = "请上传文件")]
        public IFormFile File { get; set; }

        /// <summary>
        /// 文件所在的文件夹
        /// </summary>
        [Required(ErrorMessage = "请填写文件夹标识码")]
        public Guid Folder { get; set; }
    }

    /// <summary>
    /// 文件资源表dto
    /// </summary>
    public class FileResourceDto
    {
        /// <summary>
        /// 文件唯一标识
        /// </summary>
        public Guid Id { get; set; }
        /// <summary>
        /// 文件原始名称
        /// </summary>
        public string FileName { get; set; }
        /// <summary>
        /// 文件存储路径或 URL
        /// </summary>
        public string FilePath { get; set; }
        /// <summary>
        /// 文件大小（字节）
        /// </summary>
        public long FileSize { get; set; }
        /// <summary>
        /// 文件 扩展名 类型
        /// </summary>
        public string Extension { get; set; }

        /// <summary>
        /// 文件Mime类型
        /// </summary>
        public string Mime { get; set; }

        /// <summary>
        /// 所属文件夹ID
        /// </summary>
        public Guid? FolderId { get; set; }
        /// <summary>
        /// 上传时间
        /// </summary>
        public DateTime CreatedAt { get; set; }
        /// <summary>
        /// 上传人
        /// </summary>
        public long CreatedBy { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdatedAt { get; set; }
        /// <summary>
        /// 更新人
        /// </summary>
        public long UpdatedBy { get; set; }

        /// <summary>
        /// 文件图标
        /// </summary>
        public string Icon { get; set; }

        /// <summary>
        /// 文件大类
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// 网络地址
        /// </summary>
        public string Url { get; set; }
    }
}
